From b84cc28da9229aa358e80245fe52e33f822fe8b9 Mon Sep 17 00:00:00 2001 From: "arun.sharma@intel.com[kaf24]" Date: Thu, 24 Feb 2005 09:39:21 +0000 Subject: [PATCH] bitkeeper revision 1.1236.1.9 (421da0c9oRchQk9qH4h9W-dsF3I1Jg) [PATCH] gpa-page-zero.patch GPFN = 0 is a valid page frame and we shouldn't inject #PG into guest. Signed-off-by: Arun Sharma Index: trunk/xen/arch/x86/vmx.c =================================================================== --- xen/arch/x86/vmx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/vmx.c b/xen/arch/x86/vmx.c index a14a145521..4b47e52c2c 100644 --- a/xen/arch/x86/vmx.c +++ b/xen/arch/x86/vmx.c @@ -108,7 +108,7 @@ static void inline __update_guest_eip(unsigned long inst_len) static int vmx_do_page_fault(unsigned long va, struct xen_regs *regs) { unsigned long eip; - unsigned long gpa; + unsigned long gpte, gpa; int result; #if VMX_DEBUG @@ -130,9 +130,10 @@ static int vmx_do_page_fault(unsigned long va, struct xen_regs *regs) return 0; } - gpa = gva_to_gpa(va); - if (!gpa) - return 0; + gpte = gva_to_gpte(va); + if (!(gpte & _PAGE_PRESENT) ) + return 0; + gpa = (gpte & PAGE_MASK) + (va & ~PAGE_MASK); if (mmio_space(gpa)) handle_mmio(va, gpa); -- 2.30.2